class Solution(object):
    def removeDuplicates(self, s):
        """
        :type s: str
        :rtype: str
        """
        st = []
        for c in s:
            if not st:
                st.append(c)
            else:
                if c == st[-1]:
                    st.pop()
                else:
                    st.append(c)
        return ''.join(st)